package lv.senan.clients.manatee;

/**
 * Contains functions for producing syntactically correct requests to Manatee server.
 * 
 * @author Igors Gulbinskis
 */
public class RequestProducer {
	
	public static String produceConnectionRequest(String username, String password) {
		return String.format("user %s %s", username, password);
	}
	
	public static String produceSetQueryRequest(String corpus, String query) {
		return String.format("set query %s %s", corpus, query);
	}
	
	public static String producePendQueryRequest() {
		return "pend query";
	}
	
	public static String produceGetQueryResultCountRequest() {
		return "len query";
	}
	
	public static String produceGetQueryErrorRequest() {
		return "err query";
	}
	
	public static String produceSetQueryCorpusRequest(String corpus) {
		return String.format("lsdpos %s", corpus);
	}
	
	public static String produceGetQueryResult(String dimension, int startIndex, int endIndex) {
		return String.format("get query %s %s -40# 40# word %s", startIndex, endIndex, dimension);
	}
	
}
